package com.yowasa.xiuxian.engine.hone;

import com.yowasa.xiuxian.annoations.SE;
import com.yowasa.xiuxian.entity.bo.CostTravelInterface;
import com.yowasa.xiuxian.entity.bo.DescInterface;
import com.yowasa.xiuxian.entity.bo.LimitCheckInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import org.apache.commons.lang3.tuple.Pair;

public interface SpecialInterface extends CostTravelInterface, LimitCheckInterface, DescInterface {

    //描述
    String desc();

    //写入描述
    default Pair<String, String> getItemDesc() {
        SE annotation = this.getClass().getAnnotation(SE.class);
        if (annotation == null) {
            return null;
        }
        String name = annotation.name();
        return Pair.of(name, "[神通]" + name + "\n限制:" + limitDesc() + "\n描述:" + desc());
    }

    //基础提高的道行
    default int upAbility() {
        SE annotation = this.getClass().getAnnotation(SE.class);
        if (annotation == null) {
            return 0;
        }
        return annotation.upAbility();
    }

    //基础提高的历练
    default int baseNeedTravel() {
        SE annotation = this.getClass().getAnnotation(SE.class);
        if (annotation == null) {
            return 0;
        }
        return annotation.needTravel();
    }

    //对战斗力的影响
    default void effectBattle(UserBO userBO, UserBattle userBattle) {

    }

    ;

    //学习成功时影响一次
    default void effectOnce(UserBO userBO) {

    }

    ;


}
